package com.bw.goods.mvvm.widegt;

import android.content.Context;
import android.graphics.Color;

import androidx.annotation.Nullable;

import com.yanyusong.y_divideritemdecoration.Y_Divider;
import com.yanyusong.y_divideritemdecoration.Y_DividerBuilder;
import com.yanyusong.y_divideritemdecoration.Y_DividerItemDecoration;

/**
 * @author KK
 * @description:
 * @date :2021/10/15 15:28
 */
public class Divder extends Y_DividerItemDecoration {
    public Divder(Context context) {
        super(context);
    }

    @Override
    public Y_Divider getDivider(int itemPosition) {
        Y_Divider divider = null;
        if(itemPosition % 2 !=0){
            //整数->左侧
            divider = new Y_DividerBuilder()
                    .setBottomSideLine(true, Color.GRAY,2,0,0)
                    .setRightSideLine(true,Color.GRAY,2,0,0).create();

        }else {
            divider = new Y_DividerBuilder()
                    .setBottomSideLine(true,Color.GRAY,2,0,0).create();
        }
        return divider;
    }
}
